package com.gopay.common.domain.cbrmb;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;

import com.gopay.common.cipher.utils.SensitiveInfoUtils;
import com.gopay.common.domain.BaseEntity;

/**
 * 跨境人民币 境内银行账户信息表
 * @CbRmbBankAcctInfo.java
 * @author lailingyu
 * @2016-7-1 上午11:44:32  www.gopay.com.cn Inc.All rights reserved.
 */
@Entity
@Table(name = "CB_RMB_BANK_ACCT_INFO")
public class CbRmbBankAcctInfo extends BaseEntity {

	/**
	 * serialVersionUID
	 */
	private static final long serialVersionUID = 8671989478633631409L;

    private Long sq;

    private String custId;

    private String recvBankCode;

    private String recvBankName;

    private String recvBankBranchName;

    private String recvBankAcctName;

    private String recvBankAcctNum;

    private String recvBankProvinceCode;

    private String recvBankProvinceName;

    private String recvBankCityCode;

    private String recvBankCityName;

    private String recvBankPbocNum;

    private Date createdTs;

    private Date lastUpdTs;

    private String defaultFlag;
    
    private String delFlag;

    @Id
    @SequenceGenerator(name="CbRmbBankAcctInfoSequence",sequenceName="CB_RMB_BANK_ACCT_INFO_SEQ")
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="CbRmbBankAcctInfoSequence")
    @Column(name="SQ", unique=true, nullable=false)
    public Long getSq() {
        return sq;
    }

    public void setSq(Long sq) {
        this.sq = sq;
    }

    @Column(name="CUST_ID")
    public String getCustId() {
        return custId;
    }

    public void setCustId(String custId) {
        this.custId = custId;
    }

    @Column(name="RECV_BANK_CODE")
    public String getRecvBankCode() {
        return recvBankCode;
    }

    public void setRecvBankCode(String recvBankCode) {
        this.recvBankCode = recvBankCode;
    }

    @Column(name="RECV_BANK_NAME")
    public String getRecvBankName() {
        return recvBankName;
    }

    public void setRecvBankName(String recvBankName) {
        this.recvBankName = recvBankName;
    }

    @Column(name="RECV_BANK_BRANCH_NAME")
    public String getRecvBankBranchName() {
        return recvBankBranchName;
    }

    public void setRecvBankBranchName(String recvBankBranchName) {
        this.recvBankBranchName = recvBankBranchName;
    }

    @Column(name="RECV_BANK_ACCT_NAME", length = 150)
    public String getRecvBankAcctName() {
        /**
         * modify by lly，在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
         */
        this.recvBankAcctName = SensitiveInfoUtils.autoReencrypt(this.recvBankAcctName);
        return SensitiveInfoUtils.smartDecryptWithCheck(this.recvBankAcctName);
    }

    public void setRecvBankAcctName(String recvBankAcctName) {
        /**
         * modified by zyt，判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
         */
        this.recvBankAcctName = SensitiveInfoUtils.smartEncryptWithCheck(recvBankAcctName);
    }

    @Column(name="RECV_BANK_ACCT_NUM", length = 150)
    public String getRecvBankAcctNum() {
        /**
         * modify by lly，在程序中获取的时候进行解密操作，如果是hibernate自己调用（save等），则返回原值；
         */
        this.recvBankAcctNum = SensitiveInfoUtils.autoReencrypt(this.recvBankAcctNum);
        return  SensitiveInfoUtils.smartDecryptWithCheck(this.recvBankAcctNum);
    }

    public void setRecvBankAcctNum(String recvBankAcctNum) {
        /**
         * modified by lly，判断传入字符串是否经过加密，如果是，则设置为原文，否则设置为加密后的值
         */
        this.recvBankAcctNum = SensitiveInfoUtils.smartEncryptWithCheck(recvBankAcctNum);
    }

    @Column(name="RECV_BANK_PROVINCE_CODE")
    public String getRecvBankProvinceCode() {
        return recvBankProvinceCode;
    }

    public void setRecvBankProvinceCode(String recvBankProvinceCode) {
        this.recvBankProvinceCode = recvBankProvinceCode;
    }

    @Column(name="RECV_BANK_PROVINCE_NAME")
    public String getRecvBankProvinceName() {
        return recvBankProvinceName;
    }

    public void setRecvBankProvinceName(String recvBankProvinceName) {
        this.recvBankProvinceName = recvBankProvinceName;
    }

    @Column(name="RECV_BANK_CITY_CODE")
    public String getRecvBankCityCode() {
        return recvBankCityCode;
    }

    public void setRecvBankCityCode(String recvBankCityCode) {
        this.recvBankCityCode = recvBankCityCode;
    }

    @Column(name="RECV_BANK_CITY_NAME")
    public String getRecvBankCityName() {
        return recvBankCityName;
    }

    public void setRecvBankCityName(String recvBankCityName) {
        this.recvBankCityName = recvBankCityName;
    }

    @Column(name="RECV_BANK_PBOC_NUM")
    public String getRecvBankPbocNum() {
        return recvBankPbocNum;
    }

    public void setRecvBankPbocNum(String recvBankPbocNum) {
        this.recvBankPbocNum = recvBankPbocNum;
    }

    @Column(name="CREATED_TS")
    public Date getCreatedTs() {
        return createdTs;
    }

    public void setCreatedTs(Date createdTs) {
        this.createdTs = createdTs;
    }

    @Column(name="LAST_UPD_TS")
    public Date getLastUpdTs() {
        return lastUpdTs;
    }

    public void setLastUpdTs(Date lastUpdTs) {
        this.lastUpdTs = lastUpdTs;
    }

    @Column(name="DEFAULT_FLAG")
    public String getDefaultFlag() {
        return defaultFlag;
    }

    public void setDefaultFlag(String defaultFlag) {
        this.defaultFlag = defaultFlag;
    }

    @Column(name="DEL_FLAG")
	public String getDelFlag() {
		return delFlag;
	}

	public void setDelFlag(String delFlag) {
		this.delFlag = delFlag;
	}
    

}
